alert("login loading");
var localServer = google.gears.factory.create('beta.localserver');
		var store = localServer.createStore('test-store');
		var db = google.gears.factory.create('beta.database');
		db.open('database-test');
		db.execute('create table if not exists DeckNames (Deck text)');
		
var jNumber={};
 
(function ($)
{
    jNumber.setup=function()
		{	
		
		//code to capture jquery
		captureId = store.capture("lib/jquery/jquery-1.3.2.js", ourCallback);
		
		//code to capture this page
		captureId = store.capture("http://10.0.2.2:8080/WebContent/mainPage.html", ourCallback);
		//store.remove("http://10.0.2.2:8080/WebContent/mainPage.htm<script  src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>l");
		captureId = store.capture("http://10.0.2.2:8080/WebContent/js/mainPage.js", ourCallback);
		//store.remove("http://10.0.2.2:8080/WebContent/js/mainPage.js");
		
		captureId = store.capture("http://10.0.2.2:8080/images/jsu_banner.jpg", ourCallback);
		captureId = store.capture("http://10.0.2.2:8080/images/logo.jpg", ourCallback);
		
	}
	
    function loginFail() 
{
	    alert("offline, we think");
		
}



function login() {
	//this code gets JNumber & Password From Database
	alert("before jquery");
	jNumber=jQuery(".jNumber").val();
	password=jQuery(".password").val();
	alert("JNumber is "+jNumber);
 	jQuery.ajax({
	  type: "GET",
	  url: "http://10.0.2.2:8080/dm0?"+jNumber, 
	  success: handleCommands,
	  failure: loginFail
	  });
		
}


function ourCallback(url, success, captureId)
{
	console.debug("callback "+captureId);
}

})(jQuery);

jQuery(document).ready
(
    function()
	{
		jNumber.setup();
	})
